package jmu.net.chpt03;

  public class Person1 {
		private String name;
		private boolean gender;
		private int age;
		private int id;
		static int count=0;
		
		
		


		public Person1(String name, int age, int id) {
			super();
			this.name = name;
			this.age = age;
			this.id = id;
		}




		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Person1 other = (Person1) obj;
			if (age != other.age)
				return false;
			if (name == null) {
				if (other.name != null)
					return false;
			} else if (!name.equals(other.name))
				return false;
			return true;
		}


		static {
			System.out.print("");
		}
	
      public Person1(int age,String name,boolean gender) {
	      this(name, age, age);
		  this.gender=true;
	  }

	public Person1() {
		count++;
		this.id=count;
		
	}
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isGender() {
		return gender;
	}

	public void setGender(boolean gender) {
		this.gender = gender;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}
 
	@Override
	public String toString() {
		return "Person1 [name=" + name + ", gender=" + gender + ", age=" + age + ", id=" + id + "]";
	}


	public static void main(String[] args) {
		Person1 sc= new Person1();
		System.out.println(sc.toString());
		Person1 sc1= new Person1();
		System.out.println(sc1.toString());
		Person1 sc2= new Person1();
		System.out.println(sc2.toString());
		// TODO Auto-generated method stub

	}

} 
